//vuex仓库
import Vuex from 'vuex';
import Vue from 'vue';
Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        r: 100,
        g: 99,
        b: 44
    },
    mutations: {
        CHANGER(state, r) {
            state.r = r;
        },
        CHANGEG(state, g) {
            state.g = g;
        },
        CHANGEB(state, b) {
            state.b = b;
        }

    },
    actions: {
        changeR({ state, commit, dispatch }, r) {
            commit('CHANGER', r)
        },
        changeG({ state, commit, dispatch }, g) {
            commit('CHANGEG', g)
        },
        changeB({ state, commit, dispatch }, b) {
            commit('CHANGEB', b)
        }

    }
})